<?php
session_start();
include ("../db_connect.php");
$allabuse="";
$sql = mysql_query("SELECT * FROM forum_posts WHERE closed='1'");
$numrows = mysql_num_rows($sql);	
if($numrows<1)
{
$allabuse = "There is no report for abuse";
}
else
	{
		while($row = mysql_fetch_array($sql))
		{
		$id = $row['id'];
		$section_title = $row['section_title'];
		$thread_title = $row['thread_title'];
		$reply_body = $row['post_body'];
		$author_post = $row['post_author'];
		$otid = $row['otid'];
		$allabuse .= '<div id="div_delete" name="div_delete">
						Section:&nbsp; '.$section_title. '<br/>
						Thread title:&nbsp;'.$thread_title.'<br/>
						Author:&nbsp; '. $author_post .'<br/>
						Reply Body:&nbsp;'.$reply_body .'<br/>
						
						<div id="hasdelte" name="hasdelte"></div>
						<form action="javascript:deleting()" id="deleteform" name="deleteform" method="post">
							<input name="delete_id" id="delete_id" type="hidden" value="'. $id .'" />
							<input name="otid" id="otid" type="hidden" value="'. $otid .'" />
							<input name="member_id" id="member_id" type="submit" value="Delete" />
						</form>
					</div>';
		
		}
	}//end of else
?>
<html>
	<head>
	<?php include('forum_header.php'); ?>	
	<script language="javascript" type="text/javascript">
	$('#deleteform').submit(function(){$('input[type=submit]', this).attr('disabled', 'disabled');});
	function deleting() 
	{
	  var delete_id = $("#delete_id");
	  var otid = $("#otid");
	  var url= "deleting_posts.php";
      //$("#formProcessGif").show();
        $.post(url,{type: "d", delete_id:delete_id.val(), otid:otid.val()} , 
		function(data)
		{
		 $("#div_delete").remove().html(data);
		//$("#hasdelte").html(data);
		});
	}
		
	</script>
	<head>
	<body>
		<table id="tabledelete" name="tabledelete">
			<tr>
				<td>
					<?php echo $allabuse;?> 
				</td>
			</tr>
		</table>
	</body>

</html>
